package com.dd;


public class Authorization {
	
	private int userID;
	private int level;
	
	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	protected Authorization(int userID) {
        this.userID = userID;
    }
	
	protected Authorization(int userID, int level){
		this.userID = userID;
		this.level = level;
	}

	public int getUserID() {
		return userID;
	}

	public void setUserID(int userID) {
		this.userID = userID;
	}

	/*public static int LoginCheck(HttpServletRequest request, HttpSession session) {
		String uName = ParamUtils.getParameter(request, "username");
		String uPassword = ParamUtils.getParameter(request, "password");
		String sql = "select YongHuMing,DengJi from YuanGongInfoTable where YongHuMing='"
				+ uName + "' and MiMa = '" + uPassword + "'";
		DBUtil dbutil = DBUtil.getInstance();
		Map map = dbutil.getRow(sql);
		if (map == null || map.size() <= 0)
			return 0;
		else{
			session.setAttribute("currentUser", map.get("YongHuMing") );
			return ((Integer)map.get("DengJi")).intValue();
		}
	}*/
	
	public boolean isAnonymous() {
        return userID == -1;
    }
}
